class UserSettingsController < ApplicationController
  # GET /user_settings
  # GET /user_settings.json
  def index
    @user_settings = UserSetting.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @user_settings }
    end
  end

  # GET /user_settings/1
  # GET /user_settings/1.json
  def show
    @user_setting = UserSetting.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @user_setting }
    end
  end

  # GET /user_settings/new
  # GET /user_settings/new.json
  def new
    @user_setting = UserSetting.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @user_setting }
    end
  end

  # GET /user_settings/1/edit
  def edit
    @user_setting = UserSetting.find(params[:id])
  end

  # POST /user_settings
  # POST /user_settings.json
  def create
    @user_setting = UserSetting.new(params[:user_setting])

    respond_to do |format|
      if @user_setting.save
        format.html { redirect_to @user_setting, notice: 'User setting was successfully created.' }
        format.json { render json: @user_setting, status: :created, location: @user_setting }
      else
        format.html { render action: "new" }
        format.json { render json: @user_setting.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /user_settings/1
  # PUT /user_settings/1.json
  def update
    @user_setting = UserSetting.find(params[:id])

    respond_to do |format|
      if @user_setting.update_attributes(params[:user_setting])
        format.html { redirect_to dashboard_path, notice: 'User setting was successfully updated.' }
        format.json { head :ok }
      else
        format.html { render action: "edit" }
        format.json { render json: @user_setting.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /user_settings/1
  # DELETE /user_settings/1.json
  def destroy
    @user_setting = UserSetting.find(params[:id])
    @user_setting.destroy

    respond_to do |format|
      format.html { redirect_to user_settings_url }
      format.json { head :ok }
    end
  end
end
